package com.topscomm.main.config;

import com.topscomm.pm.service.IPmContractService;

import com.topscomm.pm.service.IPmCustomerService;
import org.springframework.context.annotation.Bean;
import org.springframework.remoting.caucho.HessianServiceExporter;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Description TODO
 * @Classname HessianServerConfig
 * @Date 2022/11/07
 * @Created by hdy
 */
@Component
public class HessianServerConfig {
	@Resource
	private IPmContractService pmContractService;
	@Resource
	private IPmCustomerService pmCustomerService;

	@Bean(name ="/pmHessian/pmContractService")
	public HessianServiceExporter  exportPmContractService(){
		HessianServiceExporter exporter = new HessianServiceExporter();
		exporter.setService(pmContractService);
		exporter.setServiceInterface(IPmContractService.class);
		return exporter;
	}
	@Bean(name ="/pmHessian/pmCustomerService")
	public HessianServiceExporter  exportPmCustomerService(){
		HessianServiceExporter exporter = new HessianServiceExporter();
		exporter.setService(pmCustomerService);
		exporter.setServiceInterface(IPmCustomerService.class);
		return exporter;
	}
}
